<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page import="util.*" %>
<%
if(session.getAttribute(Globals.loginInfo) == null ){
	response.sendRedirect("index.jsp");
}
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ShopNC综合多用户商城系统</title>
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<link href="css/member/header.css" rel="stylesheet" type="text/css" />
<link href="css/member/menu.css" rel="stylesheet" type="text/css" />
<link href="css/member/conter.css" rel="stylesheet" type="text/css" />
<link href="css/member/reset-fonts-grids.css" rel="stylesheet" type="text/css" />
<script src="js/jquery/jquery.js"></script>
<script src="js/jquery/jquery.form.js"></script>
<script src="js/jquery/jquery.validate.js"></script>
<script src="js/jquery/jquery.cookie.js"></script>
<script type="text/javascript">
//html style hover
$(document).ready(function(){
	$(".tabmenu").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");})
	$(".tabmenu").hover(function(){$(this).next().css("display","block");},function(){$(this).next().css("display","none");});
	$(".downmenu").hover(function(){$(this).css("display","block");},function(){$(this).css("display","none");})
	$(".nav-bg-1").hover(function(){$(this).addClass("bianse");},function(){$(this).removeClass("bianse");})
	// Text Field Style
	$('input[type=text],textarea,input[type=password]').click(function(){
		$(this).addClass('fct-input-1').blur(function (){ $(this).removeClass('fct-input-1')} );	
	});
	$('input[type=radio],input[type=checkbox]').addClass("radio");
	$(".buttom-comm").hover( function(){$(this).removeClass("buttom-comm").addClass("buttom-comm-se")},function(){$(this).removeClass("buttom-comm-se").addClass("buttom-comm")});
	$(".buttom-comm-1").hover( function(){$(this).removeClass("buttom-comm-1").addClass("buttom-comm-1-se")},function(){$(this).removeClass("buttom-comm-1-se").addClass("buttom-comm-1")});
	$(".span-button").hover( function(){$(this).removeClass("span-button").addClass("span-button-se")},function(){$(this).removeClass("span-button-se").addClass("span-button")})
});
//change language
function changeLang(langTypeValue){
	$.cookie("cdb_commonlangType", langTypeValue);
	window.location.reload();
}
</script>
</head>
<body>
<div id="doc2" class="yui-t1">
	<div id="hd">
		<div class="header">
    		<h1 class="logo"><a href="http://www.multibuy.cn"><img src="images/member/logo.gif" /></a></h1>
    			<jsp:include page="../jsp/member/top.jsp"></jsp:include>
    		<div class="clear-1"></div>
    		<div class="navpart">
      			<div class="sideleft"></div>
      			<div class="middle">
        			<ul class="menu">
        				<li ><a href="show!toOwnMain.do">我是买家</a></li><li ><a href="product!toMyProduct.do?action=list&optionId=sold">我是卖家</a></li><li class='current'><a href="user!toOwmMember.do">我的账号</a></li><li ><a href=own_shop.php?action=modi>我的店铺</a></li>        			</ul>
        			<div class="search">
          				<form action="../home/product.php" method="get">
            				<input type="text" name="keyword" class="textinput" value="" />
            				<input type="submit" value="" title="搜索" class="btn"/>
          				</form>
          				<span><a href="home/product.php?action=search">高级搜索</a></span>
					</div>
      				</div>
      				<div class="sideright"></div>
    			</div>
  		</div>
		<div class="clear-3"></div>
	</div>
	<div id="bd">
		<div class="yui-b">
			<div class="yui-g">
				<div id="my_menu" class="sdmenu">
					<ul><span>评价管理</span><li><a href='own_score.php'>评价管理</a></li></ul><ul><span>客户服务</span><li><a href='own_complaint.php'>投诉/举报</a></li><li><a href='own_credits.php'>积分明细</a></li></ul><ul><span>基本设置</span><li><a href='own_member.php'class='current'>个人信息/密码</a></li><li><a href='own_remind.php'>网站提醒设置</a></li><li><a href='own_receive.php'>收货地址</a></li></ul><ul><span>预存款管理</span><li><a href='own_predeposit.php?action=pay'>充值</a></li><li><a href='own_predeposit.php?action=cash_set'>提现</a></li><li><a href='own_predeposit.php?action=list'>查看账户明细</a></li><li><a href='own_predeposit.php?action=record_list'>查看申请记录</a></li><li><a href='own_predeposit.php?action=cash_list'>查看提现记录</a></li></ul><ul><span>站内信管理</span><li><a href='own_message.php'>信箱管理</a></li><li><a href='own_message.php?action=add'>发送短消息</a></li></ul><ul><span>应用管理</span><li><a href='../app/supply'>供求</a></li><li><a href='../app/credits_act'>积分活动</a></li><li><a href='../app/space'>会员空间</a></li></ul>				</div>
			</div>
		</div>
		<link href="css/member/ui.theme.css" rel="stylesheet" type="text/css" />
<script src="js/jquery/ui.datepicker.js"></script>
<!-- 修改密码style -->
<STYLE type=text/css>
.pwd-strength {
padding: 2px;
padding-left: 5px;
padding-right: 5px;
width: 180px;
}
.pwd-strength-box,
.pwd-strength-box-low,
.pwd-strength-box-med,
.pwd-strength-box-hi
{
color: #464646;
text-align: center;
width: 23%;
}
.pwd-strength-box-low
{
color: #FF0000;
background-color:#FFECEC;
}
.pwd-strength-box-med
{
color: #fff;
background-color: #FF7070;
}
.pwd-strength-box-hi
{
color:#fff;
background-color: #FF3D3D;
}
</STYLE>
<script type="text/javascript" language="javascript">
// JavaScript Document
$(function(){
	$("#form_modi").validate({
		event: "keyup",
		errorClass: "error",
		rules: {
			rdoGender: {required:true},
			area_id: {required:true},
			txtAddress: {required:true},
			txtZip: {number: true,min:100000,max:999999},
			txtMobilephone: {number: true,min:10000000000,max:19999999999},
			txtPhone: {number: true},
			txtOtherphone: {number: true},
			txtQQ: {number: true}
		},
		messages: {
			rdoGender: {required: "请选择性别!"},
			area_id: {required:"地区选择不能为空"},
			txtAddress: {required: "详细地址不能为空!"},
			txtZip: {number: "邮编应该为数字!",min:"邮编格式有误!",max:"邮编格式有误!"},
			txtMobilephone: {number: "手机号码应该为数字!",min:"手机格式有误!",max:"手机格式有误!"},
			txtPhone: {number: "电话号码应该为数字!"},
			txtOtherphone: {number: "电话号码应该为数字!"},
			txtQQ: {number: "QQ应该为数字!!"}
		}
	});
	$('#txtBirthday').datepicker({
		dateFormat:'yy-mm-dd',
		changeMonth: true,
		changeYear: true
	});
	tonext('#c1');
})
function tonext(whos) {
	$(whos).change(
		function(){
			var valarray=$(this).val().split('||');
			$('#area_id').val(valarray[0]);
			if (valarray[1]=='1') {
				$(this).next().attr('disabled','true').html('<option value="" selected="selected">数据正在加载中……</option>');
				$.get(
					'../home/tohtml.php',
					{action:'get_area',id:valarray[0],random_number:Math.random()},
					function(data){
						DataArray = data.split("|||");
						var a='';
						for (var i = 0; i<DataArray.length-1; i++) {
							att=DataArray[i].split("||");
							id=att[0];
							cla=att[2];
							a+='<option value="'+id+'||'+cla+'">'+att[1]+((cla=='1')?' ->':'')+'</option>';
						}

					$(whos).next().removeAttr('disabled').html('<option value="" selected="selected"></option>'+a).nextAll().html('');
					tonext($(whos).next());
					}
				)
			} else {
				$(whos).nextAll().html('').attr('disabled','true');
			};
		}
	)
};
//修改email地址
$(function(){
	$("#form_email").validate({
		event: "keyup",
		errorClass: "error",
		rules: {
			txtemail: {required:true,email:true}
		},
		messages: {
			txtemail: {required: "email地址不能为空!",email: "请输入正确格式的email!"}
		}
	});

})
//修改密码
// JavaScript Document
$(function(){
	$("#form_pass").validate({
		rules: {
			txtoldpassword: {required:true},
			txtPassword: {required:true,minlength:6,maxlength:16},
			txtrePassword: {required:true,minlength:6,maxlength:16,equalTo:'#txtPassword'}
		},
		messages: {
			txtoldpassword: {required: "请填写原密码!"},  //请填写原密码!
			txtPassword: {required: "请输入密码!",minlength: "密码长度至少是6位!",maxlength: "密码长度最长是16位!"}, //请输入密码 密码长度至少是6!  密码长度最长是16位!
			txtrePassword: {required: "重复密码不能为空!",minlength: "重复密码长度至少是6位!",maxlength: "密码长度最长是16位!",equalTo:"两次输入的密码不相同!"}
		}
	});
})
//检测密码安全等级
function checkPassword(pwd){

	var sRe=[/[a-zA-Z]/g,/\d/g,/[^a-zA-Z0-9]/g];
    	var sLe=[1,2,5];
    	var sFa=[0,0,10,20];
    	var iKn=0;
    	var iSt=0;
    	for(i=0;i<sRe.length;i++) {
    		var cMa=pwd.match(sRe[i]);
    		if(cMa!=null) {
    			iSt+=cMa.length*sLe[i];
    			iKn++;
    		}
    	}
    	iSt+=sFa[iKn];

		if(iSt == 0){
			$('#pwdLow').removeClass('pwd-strength-box-low');
			$('#pwdMed').removeClass('pwd-strength-box-med');
			$('#pwdHi').removeClass('pwd-strength-box-hi');
		}else if(iSt>20 && iSt<30){
			$('#pwdMed').addClass('pwd-strength-box-med');
		}else if(iSt>30){
			$('#pwdHi').addClass('pwd-strength-box-hi');
		}else{
			$('#pwdLow').addClass('pwd-strength-box-low');
		}
}
</script>
<div id="yui-main">
	<div class="yui-b">
		<div class="yui-g">
			<div class="y-middle">
			<!-- 修改email -->
			<s:if test="#attr.action=='email'">
				<div class="io-1"><p>修改Email地址</p></div>
				<div class="clear-9"></div>
				<div class="bg-sj bg-wu"></div>
				<div class="clear-9"></div>
				<div class="nav">
					<ul>
						<li class="nav-bg-1"><b></b><span><p><a href="user!toOwmMember.do">编辑个人信息</a></p></span></li>
						<li class="nav-bg nav-left"><b></b><span><p>修改Email地址</p></span></li>
						<li class="nav-bg-1 nav-left"><b></b><span><p><a href="user!toOwmMember.do?action=password">修改密码</a></p></span></li>
                        <li class="nav-bg-1 nav-left"><b></b><span><p><a href="user!toOwmMember.do?action=feed">我的动态</a></p></span></li>
					</ul>
				</div>
				<form action="user!toOwmMember.do?action=emailsave" method="post" name="form_email" id="form_email">
				<div class="cr-right">

					<table width="100%" class="cr-r-td" border="0" cellpadding="0">
						<tr>
							<td class="cr-1">会员名:</td>
							<td class="cr-2"><strong>${logininfo.userId}</strong></td>
						</tr>
						<tr>
							<td class="cr-1">电子邮箱:</td>
							<td class="cr-2">${logininfo.eMail}</td>
						</tr>
						<tr>
							<td class="cr-1">新邮箱地址:</td>
							<td class="cr-2"><label for="txtemail"></label><input class="in" name="txtemail" id="txtemail" type="text" /></td>
						</tr>

					</table>
			</s:if>
			<!-- 修改密码 -->
			<s:elseif test="#attr.action=='password'">
				<div class="io-1"><p>修改密码</p></div>
				<div class="clear-9"></div>
				<div class="bg-sj bg-wu"></div>
				<div class="clear-9"></div>
				<div class="nav">
					<ul>
						<li class="nav-bg-1"><b></b><span><p><a href="user!toOwmMember.do">编辑个人信息</a></p></span></li>
						<li class="nav-bg-1 nav-left"><b></b><span><p><a href="user!toOwmMember.do?action=email">修改Email地址</a></p></span></li>
						<li class="nav-bg nav-left"><b></b><span><p>修改密码</p></span></li>
                        <li class="nav-bg-1 nav-left"><b></b><span><p><a href="user!toOwmMember.do?action=feed">我的动态</a></p></span></li>
					</ul>
				</div>
				 <form action="user!toOwmMember.do?action=passwordsave" method="post" name="form_pass" id="form_pass">
				<div class="cr-right">

					<table width="100%" class="cr-r-td" border="0" cellpadding="0">
						<tr>
							<td class="cr-1">会员名:</td>
							<td class="cr-2"><strong>${logininfo.userId}</strong></td>
						</tr>
						<tr>
							<td class="cr-1">现有密码:</td>
							<td class="cr-2">
								<input class="in" name="txtoldpassword" id="txtoldpassword" value="" type="password" />
								<label style="display:none" for="txtoldpassword" class="error" metaDone="true" generated="true"></label>
							</td>
						</tr>
						<tr>
							<td class="cr-1">新的密码:</td>
							<td class="cr-2">
								<input class="in" name="txtPassword" type="password" id="txtPassword" onkeyup='checkPassword(this.value);' />
								<label style="display:none" for="txtPassword" class="error" metaDone="true" generated="true"></label>
							</td>
						</tr>
						<tr>
							<td class="cr-1">确认新密码:</td>
							<td class="cr-2"><div class="password password" id="pwdLow">低</div><div class="password" id="pwdMed">中</div><div class="password" id="pwdHi">高</div></td>
						</tr>
						<tr>
							<td class="cr-1">确认新密码:</td>
							<td class="cr-2">
								<input class="in" name="txtrePassword" type="password" id="txtrePassword" value="" />
								<label style="display:none" for="txtrePassword" class="error" metaDone="true" generated="true"></label>
							</td>
						</tr>

					</table>
			</s:elseif>
			<!-- 修改个人信息 -->
			<s:else>
				<div class="io-1"><p>编辑个人信息</p></div>
				<div class="clear-9"></div>
				<div class="bg-sj bg-wu"></div>
				<div class="clear-9"></div>
				<div class="nav">
					<ul>
						<li class="nav-bg"><b></b><span><p>编辑个人信息</p></span></li>
						<li class="nav-bg-1 nav-left"><b></b><span><p><a href="user!toOwmMember.do?action=email">修改Email地址</a></p></span></li>
						<li class="nav-bg-1 nav-left"><b></b><span><p><a href="user!toOwmMember.do?action=password">修改密码</a></p></span></li>
                        <li class="nav-bg-1 nav-left"><b></b><span><p><a href="user!toOwmMember.do?action=feed">我的动态</a></p></span></li>
					</ul>
				</div>
				<form action="user!toOwmMember.do?action=modifysave" method="post" name="form_modi" id="form_modi" enctype="multipart/form-data">
				<div class="cr-right">
					<input type="hidden" name="area_id" id="area_id" value="" />
					<table width="100%" class="cr-r-td" border="0" cellpadding="0">
						<tr>
							<td class="cr-1">会员名:</td>
							<td class="cr-2"><strong>${logininfo.userId}</strong></td>
						</tr>
						<tr>
							<td class="cr-1">会员头像:</td>
							<td class="cr-2">
																	<img src="templates/member/images/avatar.gif" /><br/><br/>
									<span><input type="file" name="memberPhoto" id="memberPhoto" /></span>
									<span class="cr-5-span">允许上传大小为4M、类型为jpg,gif,png格式的图片。</span>
															</td>
						</tr>
						<tr>
							<td class="cr-1">真实姓名:</td>
							<td class="cr-2">
																	${logininfo.name}									<span><input type="hidden" name="txtTruename" id="txtTruename" value="shopnc" /></span>
															</td>
						</tr>
						<tr>
							<td class="cr-1">出生日期:</td>
							<td class="cr-2">
								<input class="in" name="txtBirthday" id="txtBirthday" readonly="true" type="text" value="${logininfo.date}" />
								<label style="display:none;" for="f_date" class="error" metaDone="true" generated="true"></label>
							</td>
						</tr>
						<tr>
							<td class="cr-1">性别:</td>
							<td class="cr-2">
								<input type='radio' name='rdoGender' class='input_radio' id='rdoGender_m' value='m' checked ><label for='rdoGender_m'>男</label> <input type='radio' name='rdoGender' class='input_radio' id='rdoGender_f' value='f'><label for='rdoGender_f'>女</label> 								<label style="display:none" for="rdoGender" class="error" metaDone="true" generated="true"></label>
							</td>
						</tr>
						<tr>
							<td class="cr-1">电子邮箱:</td>
							<td class="cr-2">${logininfo.eMail}</td>
						</tr>
						<tr>
							<td class="cr-1">邮编:</td>
							<td class="cr-2">
								<input class="in" name="txtZip" id="txtZip" type="text" value="${logininfo.code}" />
								<label style="display:none" for="txtZip" class="error" metaDone="true" generated="true">
							</td>
						</tr>
						<tr>
							<td class="cr-1">移动电话:</td>
							<td class="cr-2">
								<input class="in" name="txtMobilephone" id="txtMobilephone" type="text" value="${logininfo.tel}" />
								<label style="display:none" for="txtMobilephone" class="error" metaDone="true" generated="true"></label>
							</td>
						</tr>
						<tr>
							<td class="cr-1">固定电话:</td>
							<td class="cr-2">
								<input class="in" name="txtPhone" id="txtPhone" type="text" value="" />
								<label style="display:none" for="txtPhone" class="error" metaDone="true" generated="true"></label>
							</td>
						</tr>
						<tr>
							<td class="cr-1">其他联系电话:</td>
							<td class="cr-2">
								<input class="in" name="txtOtherphone" id="txtOtherphone" type="text" value="" />
								<label style="display:none" for="txtOtherphone" class="error" metaDone="true" generated="true"></label>
							</td>
						</tr>
						<tr>
							<td class="cr-1">地址:</td>
							<td class="cr-2">
								<select class="wd" name="c1" id="c1">
									<option valus="" selected></option>
																												<option  value="1||1">天津</option>
																										</select>
								<select class="wd" name="c2" id="c2">
									<option value="" selected></option>
								</select>
								<select class="wd" name="c3" id="c3">
									<option value="" selected></option>
								</select>
								<select class="wd" name="c4" id="c4">
									<option value="" selected></option>
								</select>
								<label style="display:none" for="area_id" class="error" metaDone="true" generated="true"></label>
							</td>
						</tr>
						<tr>
							<td class="cr-1">详细地址:</td>
							<td class="cr-2">
								<span>
									<input class="in-2" name="txtAddress" id="txtAddress" type="text" value="" />

								</span>
								<span class="cr-5-span">请填写真实有效的信息。</span>
								<label style="display:none" for="txtAddress" class="error" metaDone="true" generated="true"></label>
							</td>
						</tr>
						<tr>
							<td class="cr-1">QQ:</td>
							<td class="cr-2">
								<input class="in" name="txtQQ" id="txtQQ" type="text" value="" />
								<label style="display:none" for="txtQQ" class="error" metaDone="true" generated="true"></label>
							</td>
						</tr>
						<tr>
							<td class="cr-1">MSN:</td>
							<td class="cr-2">
								<input class="in" name="txtMSN" id="txtMSN" type="text" value="" />
								<label style="display:none" for="txtMSN" class="error" metaDone="true" generated="true"></label>
							</td>
						</tr>
						<tr>
							<td class="cr-1">SKYPE:</td>
							<td class="cr-2">
								<input class="in" name="txtSKYPE" id="txtSKYPE" type="text" value="" />
								<label style="display:none" for="txtSKYPE" class="error" metaDone="true" generated="true"></label>
							</td>
						</tr>
						<tr>
							<td class="cr-1">TAOBAO:</td>
							<td class="cr-2">
								<input class="in" name="txtTAOBAO" id="txtTAOBAO" type="text" value="" />
								<label style="display:none" for="txtTAOBAO" class="error" metaDone="true" generated="true"></label>
							</td>
							</tr>
					</table>
				</s:else>
				</div>
				<div class="an-1 bg-an"><span class="buttom-comm"><input  name="" value="保存" type="submit" /></span></div>
				</form>
			</div>
		</div>
	</div>
</div>	</div>
	<div id="ft">
	<jsp:include page="../jsp/bottom.jsp"></jsp:include>
	</div>
	<div id="time-xl">
	Processed in 0.609861 second(s), 1 queries.
	</div>
</div>
</body>
</html>

